/*
 * Created on 25.06.2006 by leck
 *
 */
package de.devisnik.shifting.eidle;

import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.swt.widgets.Composite;

import de.devisnik.eidle.picture.FileUtils;
import de.devisnik.eidle.picture.MultiImageScreen;
import de.devisnik.eidle.screen.IScreen;
import de.devisnik.eidle.util.ScreenUtils;
import de.devisnik.shifting.impl.ReverseAutoGame;

public class MultiShiftingScreen extends MultiImageScreen {

	public MultiShiftingScreen() {
		super("Shifting");
	}

	public ImageDescriptor[] createImageDescriptors() {
		if (ShiftingPreferences.isUseScreenShot()) {
			return new ImageDescriptor[] { ImageDescriptor
					.createFromImage(ScreenUtils.getScreenImage()) };
		}
		return FileUtils.getImagesInDirectory(ShiftingPreferences
				.getGlobalImagePath());
	}

	protected IScreen createPictureScreen(final Composite parent,
			final ImageDescriptor descriptor) {
		final ShiftingScreen screen = new ShiftingScreen(new ReverseAutoGame(
				parent.getDisplay(), ShiftingPreferences.getGridX(),
				ShiftingPreferences.getGridY(), ShiftingPreferences
						.getScrambleCount(), ShiftingPreferences
						.getThinkingTime()), ShiftingPreferences
				.getShiftingDelay(), ShiftingPreferences.getShowResultTime(),
				descriptor);
		return screen;
	}
}
